package com.anXin.user.controller;

import com.anXin.gpt.BigModelNew;
import com.anXin.model.common.dtos.ResponseResult;
import com.anXin.model.common.enums.AppHttpCodeEnum;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import utils.thread.AppThreadLocalUtil;

@RestController
@RequestMapping("/talk")
public class TalkController {

    @GetMapping("/inquire/{content}")
    private ResponseResult add(@PathVariable("content") String content) throws Exception {
        if(AppThreadLocalUtil.getUser()==null)return ResponseResult.errorResult(AppHttpCodeEnum.NEED_LOGIN);
        String answer = BigModelNew.Talk(content);
        return ResponseResult.okResult(answer);

    }
}
